import layoutHeaderAside from '@/layout/header-aside'

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)

const meta = { auth: true }

export default {
    path: '/restaurant/merchant/product',
    name: 'resProduct',
    meta,
    redirect: { name: 'resProduct' },
    component: layoutHeaderAside,
    children: (pre => [
        {
            path: 'category/index',
            name: `${pre}category/index`,
            component: _import('restaurant/merchant/product/category/index'),
            meta: {
                ...meta,
                title: '分类列表'
            }
        },
        {
            path: 'taste/index',
            name: `${pre}taste/index`,
            component: _import('restaurant/merchant/product/taste/index'),
            meta: {
                ...meta,
                title: '口味列表'
            }
        },
        {
            path: 'texture/index',
            name: `${pre}texture/index`,
            component: _import('restaurant/merchant/product/texture/index'),
            meta: {
                ...meta,
                title: '口感列表'
            }
        },
        {
            path: 'remark/index',
            name: `${pre}remark/index`,
            component: _import('restaurant/merchant/product/remark/index'),
            meta: {
                ...meta,
                title: '配菜/备注'
            }
        },
        {
            path: 'singleProduct/index',
            name: `${pre}singleProduct/index`,
            component: _import('restaurant/merchant/product/singleProduct/index'),
            meta: {
                ...meta,
                title: '单品管理'
            }
        },
        {
            path: 'packageProduct/index',
            name: `${pre}packageProduct/index`,
            component: _import('restaurant/merchant/product/packageProduct/index'),
            meta: {
                ...meta,
                title: '套餐管理'
            }
        }
    ])('resProduct-')
}
